cars = ['bmw','audi','toyota','subaru']
#sort()会为列表按字母顺序排序,排序是永久性的排序
#cars.sort()
print(cars)

#按字母顺序相反顺序排序
cars.sort(reverse=True)
print(cars)

#sorted()函数是临时排序函数，不会影响原始列表的顺序
print("\n-------------------Sort()--and--Sorted()----------------------")
print("\nHere is the sorted list:")
print(cars)

print("\nHere is the original list:")
print(sorted(cars))#sorted()函数

print("\nHere is the original list agein:")
print(cars)
print("--------------------------------------------------------------")

print("\n#------------------------reverse()倒着打印列表--------------------#")
cars.reverse()
print(cars)

print("\n#------------------------len()确定列表的长度--------------------#")
lengList = len(cars)
print(lengList)
